import { Component } from 'react'
export function WrapWithLoadData(Compon, name) {
	class ProcessedComponent extends Component {
		state = {
			comments: [],
		}
		componentDidMount() {
			console.log('ProcessedComponent挂载成功name')
		}
		UNSAFE_componentWillMount() {
			const comments = JSON.parse(localStorage.getItem(name))
			this.setState({
				comments,
			})
		}
		render() {
			return (
				<Compon comments={this.state.comments} {...this.props}></Compon>
			)
		}
	}
	return ProcessedComponent
}
